package com.ht.medicaltreatment.adapter

import android.widget.ImageView
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.bean.OrderListBean

class ShiftToAdapter : BaseQuickAdapter<OrderListBean,BaseViewHolder>(R.layout.item_to_layout){
    override fun convert(holder: BaseViewHolder, item: OrderListBean) {
        val imgState = holder.getView<ImageView>(R.id.imgState)
        val tvName = holder.getView<TextView>(R.id.tvName)
        when(item.status){
            1 -> {
                tvName.text = item.orderName
                tvName.setTextColor(context.getColor(R.color.color97))
                imgState.setBackgroundResource(R.drawable.icon_daishou)
            }
            3 -> {
                tvName.text = item.orderName
                tvName.setTextColor(context.getColor(R.color.green))
                imgState.setBackgroundResource(R.drawable.icon_yishou)
            }
        }
    }

}
